package binarytree;


import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println(binaryTree.inorderTraversal(root));
//        System.out.println(binaryTree.tree2str(root));
/*        int[] in = {9,3,15,20,7};
        int[] poat = {9,15,7,20,3};*/
    }
}
 /*   public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        BinaryTree.TreeNode root01 = binaryTree.createTree01();
        BinaryTree.TreeNode E = root.left.right;
        BinaryTree.TreeNode F = root.right.left;
        System.out.println(binaryTree.lowestCommonAncestor(root, E, F).val);

*//*        System.out.println(binaryTree.isCompleteTree(root));
        System.out.println(binaryTree.isCompleteTree(root01));*//*


*//*        binaryTree.levelOrder01(root);
        System.out.println();
        binaryTree.levelOrder01(root01);
        List<List<Integer>> list = new ArrayList<>();*//*


//        binaryTree.isBalanced(root01);
        *//*binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        System.out.print("结点个数 :"+binaryTree.size(root));
        System.out.println();
        System.out.print("叶子结点个数 :"+binaryTree.getLeafNodeCount(root));
        System.out.println();
        System.out.println("k层个数 :"+binaryTree.getKLevelNodeCount(root,1));
        System.out.println("k层个数 :"+binaryTree.getKLevelNodeCount(root,2));
        System.out.println("k层个数 :"+binaryTree.getKLevelNodeCount(root,3));
        System.out.println("k层个数 :"+binaryTree.getKLevelNodeCount(root,4));
        System.out.println("k层个数 :"+binaryTree.getKLevelNodeCount(root,5));
        System.out.println("树的高度 :"+binaryTree.getHeight(root));*//*
*//*        System.out.println("存不存在某值 :"+binaryTree.find(root,'A').val);
        System.out.println("存不存在某值 :"+binaryTree.find(root,'B').val);
        System.out.println("存不存在某值 :"+binaryTree.find(root,'E').val);
        System.out.println("存不存在某值 :"+binaryTree.find(root,'H').val);*//*

    }*/